< previous page page_546 next page >

Page 546
LoadResData..
StrHolder = LoadResData(index, format)
The required index parameter can be an integer value or a string that specifies the identifier (ID) of the data in the resource file.
The format parameter is also required. The value or constant specifies the original format of the data being returned, as follows:
1
Cursor resource
2
Bitmap resource
3
Icon resource
4
Menu resource
5
Dialog box
6
String resource
7
Font directory resource
8
Font resource
9
Accelerator table
10
User-defined resource
12
Group cursor
14
Group icon

The value can also be the string name of a user-defined resource.
Inserting the Code
When you understand the commands that you can use, the code to use the resources in the resource file is quite easy. Listing 19.1 shows each control event routine needed to perform the necessary actions in the program.
LISTING 19.1. RESOURCE.TXTCOMMAND BUTTON CLICK EVENT ROUTINES TO ACCESS THE RESOURCE FILE.

8694cbadb9b1ef7075903f6f95fc1db2.gif
 1: Private Sub cmdBitmap_Click()
 2: picBitmap.Picture = LoadResPicture(6, vbResBitmap)
    Display the Calendar Bitmap
 3: End Sub
 4:

 
< previous page page_546 next page >

If you like this book, buy it!